import Track from "./Track";
import * as Cesium from 'cesium/Cesium'
import 'cesium/Widgets/widgets.css'
export default {
    changeto2D() {
        let track = new Track();
        viewer.animation.container.style.visibility = 'hidden' // 不显示动画控件
        let scene = viewer.scene;
        scene.morphTo2D(0);
        viewer.camera.setView({
            destination: Cesium.Cartesian3.fromDegrees(114.53, 16.67, 5000000),
        });

    },

    removeSameTypeTargets(type) {
        var items = viewer.entities.values;
        const arr = items.filter((e) => e._attribute && e._attribute.type && e._attribute.type == type);
        arr.forEach(e =>{
            viewer.entities.remove(e)
        })
        /*for (let i = 0; i < entities.length; i++) {
            if( entities[i]._attribute && entities[i]._attribute.type &&  entities[i]._attribute.type == type){
                viewer.entities.remove(entities[i]);
                i--;
            }
        }*/
    }
}
